import 'package:car_music/src/modules/cross/my_crossover_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_kit_dsp/flutter_kit_dsp.dart';

import '../../commont/button.dart';
import '../../commont/group_ch.dart';
import '../../commont/kcontainer.dart';
import '../eq/chat_page.dart';
import 'pass_view.dart';

class MyCrossover extends CrossoverPageDelegate<MyCrossoverController> {
  MyCrossover({super.key});

  @override
  Widget buildBody(BuildContext context, Widget child) {
    Get.lazyPut(() => MyCrossoverController());
    return Column(
      spacing: 10,
      children: [
        ///
        ChartPage(flex: 6),

        ///
        kExpanded(
            flex: 15,
            child: Container(
              padding: const EdgeInsets.all(10),
              child: Obx(() {
                final ch = globalController.rxModel.value.current_ch;
                return Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  spacing: 10,
                  children: [
                    Align(
                      alignment: Alignment.centerLeft,
                      child: SizedBox(
                        height: 25,
                        width: 80,
                        child: kMyTextButton(
                          name: 'RESET',
                          onClick: (p0) => globalController.resetHi_LowPass(),
                        ),
                      ),
                    ),
                    Flexible(flex: 4, child: PassView(tag: ch.name + ch.high_pass!.name)),
                    Flexible(flex: 4, child: PassView(tag: ch.name + ch.low_pass!.name)),
                    Flexible(flex: 2, child: ChGroupView(title: 'XO', groupList: controller.groupList)),
                  ],
                );
              }),
            )),
      ],
    );
  }
}
